import React from "react"
import Child from "./Child"
import ThemeContext from "./testContext"
class Index extends React.Component{
  constructor(props){
    super(props)
    this.state = {
      name:"这是谁想出来的傻逼写法",
      list:[],
    }
  }
  
  handleName = (newValue)=>{
    console.log("看看这傻逼执行了吗")
    this.setState((state)=>{
      return{
        ...state,
        name:newValue
      }
    })
  }

  render(){
    return (
      <>
        this is contextId
        <ThemeContext.Provider value={{
          stateDate:this.state.name,
          fackFun:this.handleName
        }}>
          <Child></Child>
        </ThemeContext.Provider>
      </>
    )
  }
}
export default Index